Skip to content

Instantly share code, notes, and snippets.

"""
The most atomic way to train and run inference for a GPT in pure, dependency-free Python.
This file is the complete algorithm.
Everything else is just efficiency.
@karpathy
"""
import os # os.path.exists
import math # math.log, math.exp

LLM Wiki

A pattern for building personal knowledge bases using LLMs.

This is an idea file, it is designed to be copy pasted to your own LLM Agent (e.g. OpenAI Codex, Claude Code, OpenCode / Pi, or etc.). Its goal is to communicate the high level idea, but your agent will build out the specifics in collaboration with you.

The core idea

Most people's experience with LLMs and documents looks like RAG: you upload a collection of files, the LLM retrieves relevant chunks at query time, and generates an answer. This works, but the LLM is rediscovering knowledge from scratch on every question. There's no accumulation. Ask a subtle question that requires synthesizing five documents, and the LLM has to find and piece together the relevant fragments every time. Nothing is built up. NotebookLM, ChatGPT file uploads, and most RAG systems work this way.

@MartinWallgren
MartinWallgren / git-fixup
Last active April 9, 2026 18:49
Select a fixup commit using fzf
#!/bin/sh
# SPDX-FileCopyrightText: 2019 Martin Wallgren
#
# SPDX-License-Identifier: MIT
function usage() {
echo "Git command to help you select which commit to create a fixup commit for."
echo ""
echo "The command will let you select a commit from a range and commit the current"
echo "staging area using the selected commit as argument to the --fixup= option. Any"
echo "extra options passed to this command will be forwarded to the git commit"
@asheroto
asheroto / Remove Webroot.ps1
Last active April 9, 2026 18:47
Forcefully removes Webroot Endpoint Protection.
#Requires -RunAsAdministrator
<#
.SYNOPSIS
Force removes Webroot SecureAnywhere remnants.
.DESCRIPTION
Designed to be run in Safe Mode. Performs process termination, uninstall attempt,
service removal, registry cleanup, and filesystem cleanup with existence checks.
#>
@gwangjinkim
gwangjinkim / uv-cheatsheet.org
Last active April 9, 2026 18:46
UV Cheatsheet

cave! `–` becomes often a single hyphen. Please be aware. (You see - it is actually a double hyphen :P).

Replaces: pyenvPurposeCommand
Install a specific Python versionuv python install <version>
List available Python versionsuv python list
Use a specific Python version in a projectuv python use <version>
Automatically install the required Python versionuv run –python <version> script.py
Pin the Python version for a projectuv python pin
@DocShotgun
DocShotgun / llamacpp-moe-offload-guide.md
Last active April 9, 2026 18:45
Guide to optimizing inference performance of large MoE models across CPU+GPU using llama.cpp and its derivatives

Performant local mixture-of-experts CPU inference with GPU acceleration in llama.cpp

Introduction

So you want to try one of those fancy huge mixture-of-experts (MoE) models locally? Well, whether you've got a gaming PC or a large multi-GPU workstation, we've got you covered. As long as you've downloaded enough RAM beforehand.

Anatomy of a MoE Model

MoE models are described in terms of their total parameters and active parameters - i.e. DeepSeek V3 671B A37B has 671B total parameters, but we are using only 37B parameters at a time during each forward pass through the model.